<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <th:block th:include="include :: header('新增用户')"/>
    <th:block th:include="include :: select2-css"/>
</head>
<body>
<div class="main-content">
    <form id="form-postpone-verify" class="form-horizontal">
        <input id="postponeId" type="hidden" name="postponeId" th:value="${taskPostpone.postponeId}"/>
        <input id="taskId" type="hidden" name="taskId" th:value="${task.taskId}"/>
        <h4 class="form-header h4">基本信息</h4>
        <div class="row">
            <div class="col-sm-12">
                <div class="form-group">
                    <label class="col-sm-2 control-label"><span style="color: red; ">*</span>任务标题：</label>
                    <div class="col-sm-10">
                        <input class="form-control" type="text"
                               maxlength="30" th:readonly="true" th:value="${task.taskTitle}">
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-12">
                <div class="form-group">
                    <label class="col-xs-2 control-label">任务内容：</label>
                    <div class="col-xs-10">
                        <textarea maxlength="500" class="form-control" rows="3" th:readonly="true">[[${task.taskContent}]]</textarea>
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-12">
                <div class="form-group">
                    <label class="col-sm-2 control-label"><span style="color: red; ">*</span>申请人：</label>
                    <div class="col-sm-10">
                        <input class="form-control" type="text"
                               maxlength="30" th:readonly="true" th:value="${taskPostpone.userCrew.crewName}">
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-12">
                <div class="form-group">
                    <label class="col-xs-2 control-label">申请原因：</label>
                    <div class="col-xs-10">
                        <textarea maxlength="500" class="form-control" rows="3" th:readonly="true">[[${taskPostpone.postponeDesc}]]</textarea>
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">开始时间：</label>
                    <div class="col-sm-8">
                        <div class="input-group date">
                            <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                            <input type="datetime-local" class="form-control" step="1" th:readonly="true"
                                   th:value="${#dates.format(task.taskStartTime,'yyyy-MM-dd')}+'T'+${#dates.format(task.taskStartTime,'HH:mm:ss')}">
                        </div>
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">完成时间：</label>
                    <div class="col-sm-8">
                        <div class="input-group date">
                            <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                            <input type="datetime-local" class="form-control" step="1" th:readonly="true"
                                   th:value="${#dates.format(task.taskEndTime,'yyyy-MM-dd')}+'T'+${#dates.format(task.taskEndTime,'HH:mm:ss')}">
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">延期至：</label>
                    <div class="col-sm-8">
                        <div class="input-group date">
                            <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                            <input id="taskEndTime" type="datetime-local" class="form-control" step="1"
                                   name="taskEndTimeStr"
                                   th:value="${#dates.format(taskPostpone.taskEndTime,'yyyy-MM-dd')}+'T'+${#dates.format(taskPostpone.taskEndTime,'HH:mm:ss')}">
                        </div>
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">是否同意：</label>
                    <div class="col-sm-8">
                        <select class="form-control" id="postpone_status" name="postponeStatus">
                            <option value="1">同意</option>
                            <option value="0">不同意</option>
                        </select>
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-12">
                <div class="form-group">
                    <label class="col-xs-2 control-label">详细意见：</label>
                    <div class="col-xs-10">
                        <textarea name="advice" maxlength="500" class="form-control" rows="3"></textarea>
                    </div>
                </div>
            </div>
        </div>
    </form>
</div>

<div class="row">
    <div class="col-sm-offset-5 col-sm-10">
        <button type="button" class="btn btn-sm btn-primary" onclick="submitHandler()"><i class="fa fa-check"></i>保 存
        </button>&nbsp;
        <button type="button" class="btn btn-sm btn-danger" onclick="closeItem()"><i class="fa fa-reply-all"></i>关 闭
        </button>
    </div>
</div>
<th:block th:include="include :: footer"/>
<th:block th:include="include :: select2-js"/>
<script>
    var prefix = ctx + "hcy/task/postpone";

    function submitHandler() {
        if ($.validate.form()) {
            var data = $("#form-postpone-verify").serializeArray();
            $.operate.saveTab(prefix + "/verify", data);
        }
    }
</script>
</body>
</html>